/******************************/
/*****	Elite Warriors	*******/
/*****	 Dark-Raptor	*******/
/******************************/


private ["_player","_path","_custom","_delete","_namespace","_name"];
_player = player;
//_path = [_this,1,[],[[]]] call bis_fnc_param;
//_custom = [_this,2,[],[[]]] call bis_fnc_param;
//_delete = [_this,3,false,[false]] call bis_fnc_param;

//_namespace = [_path,0,missionnamespace,[missionnamespace,grpnull,objnull]] call bis_fnc_paramin;
//_name = [_path,1,"",[""]] call bis_fnc_paramin;

//--- Get magazines loaded to weapons
private ["_primaryWeaponMagazine","_secondaryWeaponMagazine","_handgunMagazine"];
_primaryWeaponMagazine = "";
_secondaryWeaponMagazine = "";
_handgunMagazine = "";
{
	if (count _x > 4) then {
		private ["_weapon","_magazine"];
		_weapon = (_x select 0);
		_magazine = _x select 4 select 0;
		switch _weapon do {
			case (primaryweapon _player): {_primaryWeaponMagazine = _magazine;};
			case (secondaryweapon _player): {_secondaryWeaponMagazine = _magazine;};
			case (handgunweapon _player): {_handgunMagazine = _magazine;};
		};
	};
} foreach weaponsitems _player;

//[_primaryWeaponMagazine] call bis_fnc_log;

//--- Get current values
private ["_export"];
_gear = [
	/* 00 */	[uniform _player,uniformitems _player],
	/* 01 */	[vest _player,vestitems _player],
	/* 02 */	[backpack _player,backpackitems _player],
	/* 03 */	headgear _player,
	/* 04 */	goggles _player,
	/* 05 */	binocular _player,
	/* 06 */	[primaryweapon _player,_player weaponaccessories primaryweapon _player,_primaryWeaponMagazine],
	/* 07 */	[secondaryweapon _player,_player weaponaccessories secondaryweapon _player,_secondaryWeaponMagazine],
	/* 08 */	[handgunweapon _player,_player weaponaccessories handgunweapon _player,_handgunMagazine],
	/* 09 */	assigneditems _player - [binocular _player]
	/* 10 */	//_custom
];


["a3_gear",_gear] call EWDB_fnc_DBUpdate;
gear_old = _gear;
hint "Gear Saved to Database";


//--- Store
/*
private ["_data","_nameID"];
_data = _namespace getvariable ["bis_fnc_saveInventory_data",[]];
_nameID = _data find _name;
if (_delete) then {
	if (_nameID >= 0) then {
		_data set [_nameID,objnull];
		_data set [_nameID + 1,objnull];
		_data = _data - [objnull];
	};
} else {
	if (_nameID < 0) then {
		_nameID = count _data;
		_data set [_nameID,_name];
	};
	_data set [_nameID + 1,_export];
};
_namespace setvariable ["bis_fnc_saveInventory_data",_data];
profilenamespace setvariable ["bis_fnc_saveInventory_profile",true];
if !(isnil {profilenamespace getvariable "bis_fnc_saveInventory_profile"}) then {saveprofilenamespace};

//_export
*/